<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStorehousesTable extends Migration
{
  /**
   * 库存管理
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('storehouse', function (Blueprint $table) {
      $table->increments('id');
      $table->string('code', 100)->nullable()->comment('编码');
      $table->string('name', 100)->comment('配件名称');
      $table->unsignedSmallInteger('part_type_id')->comment('配件类别');
      $table->unsignedSmallInteger('part_company_id')->comment('配件单位');
      $table->unsignedSmallInteger('amount_unit_id')->comment('单位');
      $table->unsignedSmallInteger('car_brand')->comment('品牌');
      $table->string('purchase_price', 30)->comment('进价');
      $table->string('selling_price', 30)->comment('售价');
      $table->integer('amount')->comment('数量');
      $table->text('msg')->nullable()->comment('备注信息');
      $table->timestamps();
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    Schema::dropIfExists('storehouse');
  }
}
